package com.dayang.redbook.auth.constant;

/**
 * @author: dayang
 * @since: 2024/5/23
 * @description: redis key常量
 */
public class RedisConstants {
    /**
     * 验证码 KEY 前缀
     */
    private static final String VERIFICATION_CODE_KEY_PREFIX = "verification_code:";
    public static final long VERIFICATION_CODE_TTL = 3L;

    /**
     * 构建验证码 KEY
     * @param phone 手机号
     * @return
     */
    public static String buildVerificationCodeKey(String phone) {
        return VERIFICATION_CODE_KEY_PREFIX + phone;
    }

}
